package com.czh.system.controller.auth;

import com.czh.common.domain.AjaxRes;
import com.czh.framework.security.web.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LogoutController {

    @Autowired
    AuthService loginService;
    @PostMapping("logout")
    public AjaxRes logout() {
        boolean logout = loginService.logout();
        return logout ? AjaxRes.success("退出成功") : AjaxRes.fault("已经退出。");
    }
}
